package com.xmg.mgrsite.base.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xmg.p2p.base.domain.Logininfo;
import com.xmg.p2p.base.query.IplogQueryObject;
import com.xmg.p2p.base.query.PageResult;
import com.xmg.p2p.base.service.IIplogService;
import com.xmg.p2p.base.util.UserContext;

@Controller
public class IplogController {
	
	@Autowired
	private IIplogService iplogService;
	
	
	 @RequestMapping("ipLog")
	    public String iplogList(@ModelAttribute("qo") IplogQueryObject qo, Model model){
	        try {
	            //Logininfo current = UserContext.getCurrent();
	            
	            //qo.setUsername(current.getUsername());
	            //qo.setUserType(Logininfo.USER_CLIENT);
	            
	            PageResult pageResult = iplogService.query(qo);
	            model.addAttribute("pageResult", pageResult);
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	        return "ipLog/list";
	    }
}
